package com.weixin.project.Dao;

import com.weixin.project.Common.Enum.ClassField;
import com.weixin.project.Entity.Question;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface QuestionDao extends JpaRepository<Question, Integer>, JpaSpecificationExecutor<Question> {
    Question getQuestionByChapterIdAndPosition(Integer chapterId, Integer pos);
    Integer countQuestionsByChapterId(Integer chapterId);
    List<Question> getQuestionsByQuestionBankIdAndIntScoreAndTypeId(Integer questionBankId, Integer intScore, Integer typeId);
    List<Question> getQuestionsByClassFieldAndIntScoreAndTypeId
            (ClassField classField, Integer intScore, Integer typeId);
    Integer countQuestionsByQuestionBankId(Integer bankId);
}
